home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / c / ExtrasLib.lha / ExtrasLib / Source / CWinSize.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-30  |  1.5 KB  |  53 lines

  1. #include <clib/extras/gui_protos.h>
  2. #include <intuition/screens.h>
  3.  
  4. /****** extras.lib/OBSOLETE_CheckWindowSize ******************************************
  5. *
  6. *   OBSOLETE
  7. *       Since OS3.5 uses Reaction/ClassAct - this code is obsolete
  8. *
  9. *   NAME
  10. *       CheckWindowSize - See if a window will fit on a screen.
  11. *
  12. *   SYNOPSIS
  13. *       windowfits = CheckWindowSize(Scr, Width, Height,
  14. *                                     XScale, YScale)
  15. *
  16. *       BOOL CheckWindowSize(struct Screen *, WORD, WORD, 
  17. *                                    float, float);
  18. *
  19. *   FUNCTION
  20. *       This function checks to see if a window will fit on a screen.
  21. *
  22. *   INPUTS
  23. *       Scr - the Screen the window is destine for.
  24. *       Width - the base width of the window.
  25. *       Height - the base height of the window.
  26. *       XScale - the proposed x scale of the window.
  27. *       YScale - the proposed y scale of the window.
  28. *
  29. *   RESULT
  30. *       Returns TRUE if the window will fit, and FALSE if not.
  31. *       if the XScale or YScale is <=0 it will also fail.
  32. *
  33. *   SEE ALSO
  34. *       GetGUIScale(), CheckInnerWindowSize()
  35. *
  36. ******************************************************************************
  37. *
  38. */
  39.  
  40.  
  41. BOOL CheckWindowSize(struct Screen *Scr,
  42.                      WORD Width,
  43.                      WORD Height,
  44.                      float XScale,
  45.                      float YScale)
  46. {
  47.   if(XScale>0 && YScale>0)
  48.     if(Width*XScale<=Scr->Width || Height*YScale<=Scr->Height)
  49.       return(TRUE);
  50.   return(FALSE);
  51. }
  52.  
  53.